@directive dynamic user;
<!DOCTYPE html>
<html>
<head>@ include("/weixin/include/header.html",{"title":"查看通知"}){}
</head>
<body>
	<div  class="notice_title">${notice.title}</div>
	<div class="notice_content">${notice.content}</div>
	
	<span class="notice_time">发布时间：${notice.ctime,"yyyy-MM-dd HH:mm"}</span>


@ if(user.id==notice.creator){
	<div id="wrapper" >
		<div class="res_item_container v_align_center" id="container">
		
		</div>
		<div class="weui-infinite-scroll"  style="display:none;">
				<div class="infinite-preloader"></div>
				正在加载...
		</div>
	</div>
@}

	@ include("/weixin/include/js_import.html"){}
	@ if(user.id==notice.creator){

	<script type="text/javascript">
		var myScroll1;
		jQuery(document).ready(function($) {
			$(document.body).infinite().on("infinite", function() {
				loadMore();
			});
			loadMore();
		});
	
		var loading;
		var loaded = 0;
		var total = -1;
		var currPage = 1;
		function loadMore() {
			if (loading)
				return;
			loading = true;
			timestamp = new Date().getTime();		
			if (total <0||total>loaded) {
				$(".all_loading").show();
				console.log(1);
				$.ajax({
					type : "GET",
					url : "${basePath}/weixinNotice/loadNoticeRest?noticeId="+${notice.id}+"&page=" + currPage,
					success : function(data) {
						var datas = data.data;
						if(datas.length > 0){
							for(var i in datas){
								var temp = datas[i];
								var str = "<div class=\"res_item h_dir\">";
								str = str + "<div class=\"res_item_right\"><span>"+temp.name+"</span>";
								if(temp.is_read==1){
									str = str + "<div class=\"res_read readed h_dir\">";
								}else{
									str = str + "<div class=\"res_read h_dir\">";
								}
								str = str + "<span></span><span class=\"read_time\">("+temp.ctime+")</span></div></div></div>";
								$("#container").append(str);
							 }
						}						
						
						if(total== -1){
							total = data.total;
						}
						loaded = loaded + 10;
						
						currPage = currPage+1;
						if(total > loaded){
							loading = false;
						}else{
							$(".weui-infinite-scroll").hide();
							$("body div").destroyInfinite();
						}
					}
				});
			} else {
				loading = true;
			}
		}
		
		
	</script>
		@}
</body>
</html>